package com.itgaoshu.hospitalproject.controller;

import com.itgaoshu.hospitalproject.bean.User;
import com.itgaoshu.hospitalproject.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * 登录功能
 * shiro安全框架
 * 导航栏模块的跳转功能
 */
@Controller
public class SysController {
    @Autowired
    private UserService userService;
    //查询用户个人资料的方法
    @RequestMapping("toUpdateLogin")
    public String toUpdateLogin(User user, Integer userid, Model model){
        User user1 = userService.toUpdateLogin(user);
        List<User> usersLogin = new ArrayList<>();
        usersLogin.add(user1);
        model.addAttribute("usersLogin",usersLogin);
        //跳转到updateLogin.html页面
        return "view/user/updateLogin";
    }

    //=========系统管理模块===========
    //跳转菜单控制页面menuManager.html
    @RequestMapping("toMenuManager")
    public String toMenuManager(){
        return "view/menu/menuManager";
    }

    //跳转菜单控制页面左侧：显示菜单树 -- menuLeft页面
    @RequestMapping("toMenuLeft")
    public String toMenuLeft(){
        return "view/menu/menuLeft";
    }

    //跳转菜单控制页面右侧：显示菜单操作-- menuRight页面
    @RequestMapping("toMenuRight")
    public String toMenuRight(){
        return "view/menu/menuRight";
    }

    //跳转到角色加载
    @RequestMapping("toLoadAllRole")
    public String toLoadAllRole() {
        return "view/role/roleManager";
    }

    //跳转到用户加载
    @RequestMapping("toLoadAllUser")
    public String toLoadAllUser() {
        return "view/user/userManager";
    }

    //跳转到图标管理
    @RequestMapping("icon")
    public String icon() {
        return "view/center/icon";
    }

    //=========统计管理模块===========
    //跳转到门诊月度统计页面
    @RequestMapping("toReportFinance")
    public String toReportFinance() {
        return "view/finance/reportManage";
    }

    //跳转至住院月度统计页面
    @RequestMapping("toZhuYaunManage")
    public String toZhuYaunManage() {
        return "view/finance/zhuYuanManage";
    }

    //跳转至门诊年度统计页面
    @RequestMapping("toBingYear")
    public String toBingYear() {
        return "view/finance/reportBing";
    }

    //跳转至住院年度统计页面
    @RequestMapping("toBing2")
    public String toBing2() {
        return "view/finance/zhuYuanBing";
    }

    //跳转至医生统计对比页面
    @RequestMapping("toDoctorDuibi")
    public String toDoctorDuibi() {
        return "view/finance/doctorDuibi";
    }

    //跳转至门诊当天统计页面
    @RequestMapping("toCurrent")
    public String toCurrenti() {
        return "view/finance/current";
    }

    //===============================

    //跳转到显示页面 -- 显示排班页面
    @RequestMapping("toMain")
    public String toMain(){
        return "view/main/main";
    }

    @RequestMapping("/toDoctor")
    public String login(){
        return "view/center/doctor";
    }

    @RequestMapping("/toDrugdictionary")
    public String login1(){
        return "view/center/drugdictionary";
    }

    @RequestMapping("toArea")
    public String ceshi(){
        return "view/center/area";
    }

    @RequestMapping("toDepartments")
    public String ceshi2(){
        return "view/center/departments";
    }


    @RequestMapping("toProjectTypeManage")
    public String ceshi3(){
        return "view/center/projectTypeManage";
    }

    @RequestMapping("toRegisteredType")
    public String ceshi4(){
        return "view/center/registeredType";
    }
    //==============================
    @RequestMapping("toSkull")
    public String ceshi5(){
        return "view/center/skull";
    }

    @RequestMapping("toSupply")
    public String ceshi6(){
        return "view/center/supply";
    }

    @RequestMapping("toType")
    public String ceshi7(){
        return "view/center/type";
    }

    @RequestMapping("toUnit")
    public String ceshi8(){
        return "view/center/unit";
    }

    @RequestMapping("toWarehuose")
    public String ceshi9(){
        return "view/center/warehuose";
    }

    @RequestMapping("toPaiban")
    public String ceshi10(){
        return "view/center/paiban";
    }

    @RequestMapping("liao/pharmacy")
    public String zhuyuan(){
        return "liao/pharmacy";
    }

}
